﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A87复习ref
{
    class Program
    {
        static void Main1(string[] args)
        {
            int a = 5;
            Fun1(a);
            Console.WriteLine(a);//5
        }
        static void Fun1(int a  )
        {
            a = 6;
        }

        static void Main2(string[] args)
        {
            int[] array = { 2, 3 };
            Fun2(array);
            Console.WriteLine(array[0]);//1
        }

        static void Fun2(int[] array) 
        {
            array[0] = 1;
        }

        static void Main(string[] args)
        {
            int[] array = { 2, 3 };
            Fun3(ref array);
            Console.WriteLine(array[0]); //4

        }

        static void Fun3(ref int[] array) 
        {
            int[] newArray = { 4, 5 };
            array = newArray;
        }
    }

     
}
